﻿if exists (select * from sysobjects where id = OBJECT_ID('[BdDic]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [BdDic]

CREATE TABLE [BdDic] (
[DicID] [uniqueidentifier]  NOT NULL,
[DicName] [nvarchar]  (50) NOT NULL,
[DicCode] [nvarchar]  (50) NOT NULL,
[TypeID] [uniqueidentifier]  NOT NULL,
[TypeName] [nvarchar]  (50) NOT NULL,
[ParentID] [uniqueidentifier]  NOT NULL,
[OrderNo] [int]  NOT NULL,
[Level] [int]  NOT NULL,
[Path] [nvarchar]  (500) NOT NULL,
[Disabled] [bit]  NOT NULL,
[CreateBy] [uniqueidentifier]  NOT NULL,
[CreateDate] [datetime]  NOT NULL,
[ModifyBy] [uniqueidentifier]  NOT NULL,
[ModifyDate] [datetime]  NOT NULL)

INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'fcc07729-5b64-4748-afd3-0fcb383dffb9',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'4e4174cd-2a7d-46d3-86b5-21f1c95f09ae',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'b8ea0217-deb3-448c-8318-280854dd2b58',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'3d78510d-0d3c-429d-aa90-2edc710cf79d',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'017a5d87-088f-4e1f-8106-3216119d2bec',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'a7480814-6026-4d12-97e2-3be8144244c0',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'44b17dc0-24cb-49ac-a434-3dff65a83987',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'39207a12-dcd8-4a7e-ad0d-4c2032df98d1',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'4cf4e800-7d7a-4c39-814d-63e2e0c591f0',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'18851473-2d71-44e8-beaf-6bbf943616bb',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'317a0cd3-da44-4758-8af3-96ee0aec5cfd',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'9566cab4-561a-4b24-91e6-9ba2a2cc821a',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'fbf12efb-e5fa-44d9-8a78-9f02e64ad02f',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'56a69133-97ff-4746-98d1-a31c96faeb58',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'7062b3ed-da91-4f6f-baa3-ad60ee2bbee0',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'ef27268d-aa0c-4094-a89e-b24c282646cf',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'cfd5ed03-51dd-416c-b226-c4e1afeb7cd8',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'53c63bdd-2563-4633-a615-cb101642fd59',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'8933c6a7-b82d-468b-aa29-d0b850f03141',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'9be6c1d6-3f17-4f44-88af-d9793c0c5c3e',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'903f2307-268c-4b53-81c8-e4b7c4eb44d7',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'8dde065e-acb4-4ff0-8346-ed675026de90',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'92183595-4cc1-414f-927a-f2493b8fe227',0)
INSERT [BdDic] ([DicID],[Disabled]) VALUES ( N'de84d839-3ad2-49e2-9fbf-f286d0945aeb',0)
if exists (select * from sysobjects where id = OBJECT_ID('[BdDicType]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [BdDicType]

CREATE TABLE [BdDicType] (
[TypeID] [uniqueidentifier]  NOT NULL,
[TypeName] [nvarchar]  (50) NOT NULL,
[TypeCode] [nvarchar]  (50) NOT NULL,
[Disabled] [bit]  NOT NULL,
[CreateBy] [uniqueidentifier]  NOT NULL,
[CreateDate] [datetime]  NOT NULL,
[ModifyBy] [uniqueidentifier]  NOT NULL,
[ModifyDate] [datetime]  NOT NULL)

INSERT [BdDicType] ([TypeID],[TypeName],[TypeCode],[Disabled],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'2cdf8be2-28d7-466c-bf67-26d5078f51ba',N'省市',N'ProCity',0,N'00000000-0000-0000-0000-000000000000',N'2011/12/27 10:41:29',N'00000000-0000-0000-0000-000000000000',N'2012/2/20 16:37:27')
INSERT [BdDicType] ([TypeID],[TypeName],[TypeCode],[Disabled],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'e5822ffc-c1ea-4136-a06d-a8226a1e549a',N'区域',N'area',0,N'00000000-0000-0000-0000-000000000000',N'2011/12/27 12:27:32',N'00000000-0000-0000-0000-000000000000',N'2011/12/27 12:27:46')
INSERT [BdDicType] ([TypeID],[TypeName],[TypeCode],[Disabled],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'b3c4a12a-525f-48d6-870b-acf61834bb14',N'test',N'test',0,N'00000000-0000-0000-0000-000000000000',N'2011/12/30 15:11:24',N'00000000-0000-0000-0000-000000000000',N'2011/12/30 15:11:33')
if exists (select * from sysobjects where id = OBJECT_ID('[SysMenu]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [SysMenu]

CREATE TABLE [SysMenu] (
[MenuID] [uniqueidentifier]  NOT NULL,
[Name] [nvarchar]  (50) NOT NULL,
[Code] [varchar]  (50) NOT NULL,
[ParentID] [uniqueidentifier]  NOT NULL,
[Url] [varchar]  (100) NOT NULL,
[OrderNo] [int]  NOT NULL,
[Level] [int]  NOT NULL,
[Path] [varchar]  (200) NOT NULL,
[Icon] [varchar]  (50) NOT NULL,
[CreateBy] [uniqueidentifier]  NOT NULL,
[CreateDate] [datetime]  NOT NULL,
[ModifyBy] [uniqueidentifier]  NOT NULL,
[ModifyDate] [datetime]  NOT NULL)

INSERT [SysMenu] ([MenuID],[Name],[Code],[ParentID],[OrderNo],[Level],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'861a8d72-05e7-42df-8c3d-198b2c7a4d0e',N'基础数据',N'Base Data',N'cb362b2a-cd20-4e5f-8a18-5065913ea6cb',2,2,N'00000000-0000-0000-0000-000000000000',N'2011/12/26 18:29:04',N'00000000-0000-0000-0000-000000000000',N'2011/12/26 18:29:29')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[OrderNo],[Level],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'052afdb6-2616-4e30-a42a-35c011855044',N'权限相关',N'cb362b2a-cd20-4e5f-8a18-5065913ea6cb',1,2,N'00000000-0000-0000-0000-000000000000',N'2012/1/6 11:33:02',N'00000000-0000-0000-0000-000000000000',N'2012/1/6 11:36:17')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[Icon],[ModifyBy],[ModifyDate]) VALUES ( N'cb362b2a-cd20-4e5f-8a18-5065913ea6cb',N'系统管理',N'00000000-0000-0000-0000-000000000000',N'a21.aspx',2,1,N'33',N'00000000-0000-0000-0000-000000000000',N'2012/2/20 16:30:38')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'3ece254b-15f5-44a7-86ce-5ad6680bb0a2',N'人员维护',N'052afdb6-2616-4e30-a42a-35c011855044',N'Pages/Rights/UserList.aspx',1,3,N'00000000-0000-0000-0000-000000000000',N'2012/1/6 16:28:07',N'00000000-0000-0000-0000-000000000000',N'2012/1/6 16:32:23')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'86c7b575-117c-4745-9314-79a1a7800d56',N'aa',N'63183e4c-9143-451f-926d-bdbef85f6438',N'aa',1,3,N'00000000-0000-0000-0000-000000000000',N'2011/12/26 19:16:41',N'00000000-0000-0000-0000-000000000000',N'2011/12/26 19:16:48')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'725da920-4a9e-4e71-86bd-7e0e1ca8fe10',N'数据字典类型',N'861a8d72-05e7-42df-8c3d-198b2c7a4d0e',N'Pages/Base/DicTypeList.aspx',1,3,N'00000000-0000-0000-0000-000000000000',N'2011/12/26 18:29:44',N'00000000-0000-0000-0000-000000000000',N'2011/12/26 18:30:21')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[ModifyBy],[ModifyDate]) VALUES ( N'1fbc819b-4b36-4b9e-9840-8262f56e362e',N'业务流程',N'00000000-0000-0000-0000-000000000000',N'aa.aspx',3,1,N'00000000-0000-0000-0000-000000000000',N'2012/2/20 15:27:07')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[ModifyBy],[ModifyDate]) VALUES ( N'2bd32629-b4ab-4220-9974-8283e5eb35e8',N'其他相关',N'1fbc819b-4b36-4b9e-9840-8262f56e362e',N'aa1.aspx',2,2,N'00000000-0000-0000-0000-000000000000',N'2011/12/26 19:16:33')
INSERT [SysMenu] ([MenuID],[Name],[Code],[ParentID],[Url],[OrderNo],[Level],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'8cfc9860-29ae-46f9-bafa-96f7d157af7b',N'数据字典',N'code',N'861a8d72-05e7-42df-8c3d-198b2c7a4d0e',N'Pages/Base/TreeDicList.aspx',2,3,N'00000000-0000-0000-0000-000000000000',N'2011/12/27 20:22:09',N'00000000-0000-0000-0000-000000000000',N'2011/12/27 21:21:51')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'38c0d5a8-0adf-4b26-b1f5-b8110c2fa57e',N'角色维护',N'052afdb6-2616-4e30-a42a-35c011855044',N'Pages/Rights/RoleList.aspx',2,3,N'00000000-0000-0000-0000-000000000000',N'2012/1/6 11:34:41',N'00000000-0000-0000-0000-000000000000',N'2012/1/6 16:32:17')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[ModifyBy],[ModifyDate]) VALUES ( N'63183e4c-9143-451f-926d-bdbef85f6438',N'流程相关',N'1fbc819b-4b36-4b9e-9840-8262f56e362e',N'aa.aspx',1,2,N'00000000-0000-0000-0000-000000000000',N'2011/12/26 19:16:21')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'c3beeb09-ab1a-4fbd-a3b4-c8efe6ea929a',N'菜单维护',N'96896f94-158f-45c2-b0c9-e8864193d941',N'Pages/Systems/MenuList.aspx',2,3,N'00000000-0000-0000-0000-000000000000',N'2011/12/22 16:08:11',N'00000000-0000-0000-0000-000000000000',N'2011/12/26 17:11:39')
INSERT [SysMenu] ([MenuID],[Name],[ParentID],[Url],[OrderNo],[Level],[ModifyBy],[ModifyDate]) VALUES ( N'96896f94-158f-45c2-b0c9-e8864193d941',N'系统维护',N'cb362b2a-cd20-4e5f-8a18-5065913ea6cb',N'aa.aspx',11,2,N'00000000-0000-0000-0000-000000000000',N'2011/12/26 18:27:48')
if exists (select * from sysobjects where id = OBJECT_ID('[SysRole]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [SysRole]

CREATE TABLE [SysRole] (
[RoleID] [uniqueidentifier]  NOT NULL,
[RoleName] [nvarchar]  (50) NOT NULL,
[Disabled] [bit]  NOT NULL,
[CreateBy] [uniqueidentifier]  NOT NULL,
[CreateDate] [datetime]  NOT NULL,
[ModifyBy] [uniqueidentifier]  NOT NULL,
[ModifyDate] [datetime]  NOT NULL)

INSERT [SysRole] ([RoleID],[RoleName],[Disabled],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'c5141d4b-a9d5-4a73-8d67-bc8e8ecc2a26',N'系统管理员',0,N'00000000-0000-0000-0000-000000000000',N'2012/1/6 11:38:00',N'00000000-0000-0000-0000-000000000000',N'2012/1/6 11:38:15')
if exists (select * from sysobjects where id = OBJECT_ID('[SysUser]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [SysUser]

CREATE TABLE [SysUser] (
[UserID] [uniqueidentifier]  NOT NULL,
[UserName] [nvarchar]  (100) NOT NULL,
[Pwd] [nvarchar]  (50) NOT NULL,
[Email] [nvarchar]  (50) NOT NULL,
[Disabled] [bit]  NOT NULL,
[CreateBy] [uniqueidentifier]  NOT NULL,
[CreateDate] [datetime]  NOT NULL,
[ModifyBy] [uniqueidentifier]  NOT NULL,
[ModifyDate] [datetime]  NOT NULL)

INSERT [SysUser] ([UserID],[UserName],[Email],[Disabled],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'f2bd505e-cee0-4c51-89f4-281c1e3dc22a',N'user1',N'user@a552254.com',0,N'00000000-0000-0000-0000-000000000000',N'2012/1/6 16:32:34',N'00000000-0000-0000-0000-000000000000',N'2012/2/20 16:22:36')
if exists (select * from sysobjects where id = OBJECT_ID('[SysUserRole]') and OBJECTPROPERTY(id, 'IsUserTable') = 1) 
DROP TABLE [SysUserRole]

CREATE TABLE [SysUserRole] (
[UserRoleID] [uniqueidentifier]  NOT NULL,
[UserID] [uniqueidentifier]  NOT NULL,
[RoleID] [uniqueidentifier]  NOT NULL,
[CreateBy] [uniqueidentifier]  NOT NULL,
[CreateDate] [datetime]  NOT NULL,
[ModifyBy] [uniqueidentifier]  NOT NULL,
[ModifyDate] [datetime]  NOT NULL)

INSERT [SysUserRole] ([UserRoleID],[UserID],[RoleID],[CreateBy],[CreateDate],[ModifyBy],[ModifyDate]) VALUES ( N'62252ff6-b972-4c4b-ac08-511bc09a3d8f',N'f2bd505e-cee0-4c51-89f4-281c1e3dc22a',N'c5141d4b-a9d5-4a73-8d67-bc8e8ecc2a26',N'00000000-0000-0000-0000-000000000000',N'2012/3/6 16:38:37',N'00000000-0000-0000-0000-000000000000',N'2012/3/6 16:38:37')
